/**
 * 
 */
package sk.stuba.fiit.foo07.genex.beans;

import java.sql.Timestamp;

/**
 * @author Martin
 * 
 */
public class Question implements Comparable<Question> {

    private String text;
    private Integer difficulty;
    private Timestamp created;
    private Timestamp lastUpdate;
    private Integer questionID;
    private Integer userID;
    private Integer questionTypeID;
    private Integer derivedFromID;

    public Question() {
    }

    public Question(String text, Integer difficulty, Timestamp created,
            Timestamp lastUpdate, Integer questionID, Integer userID,
            Integer questionTypeID, Integer derivedFromID) {
        super();
        this.text = text;
        this.difficulty = difficulty;
        this.created = created;
        this.lastUpdate = lastUpdate;
        this.questionID = questionID;
        this.userID = userID;
        this.questionTypeID = questionTypeID;
        this.derivedFromID = derivedFromID;
    }

    /**
     * @return the text
     */
    public String getText() {
        return text;
    }

    /**
     * @param text
     *                the text to set
     */
    public void setText(String text) {
        this.text = text;
    }

    /**
     * @return the difficulty
     */
    public Integer getDifficulty() {
        return difficulty;
    }

    /**
     * @param difficulty
     *                the difficulty to set
     */
    public void setDifficulty(Integer difficulty) {
        this.difficulty = difficulty;
    }

    /**
     * @return the created
     */
    public Timestamp getCreated() {
        return created;
    }

    /**
     * @param created
     *                the created to set
     */
    public void setCreated(Timestamp created) {
        this.created = created;
    }

    /**
     * @return the lastUpdate
     */
    public Timestamp getLastUpdate() {
        return lastUpdate;
    }

    /**
     * @param lastUpdate
     *                the lastUpdate to set
     */
    public void setLastUpdate(Timestamp lastUpdate) {
        this.lastUpdate = lastUpdate;
    }

    /**
     * @return the questionID
     */
    public Integer getQuestionID() {
        return questionID;
    }

    /**
     * @param questionID
     *                the questionID to set
     */
    public void setQuestionID(Integer questionID) {
        this.questionID = questionID;
    }

    /**
     * @return the userID
     */
    public Integer getUserID() {
        return userID;
    }

    /**
     * @param userID
     *                the userID to set
     */
    public void setUserID(Integer userID) {
        this.userID = userID;
    }

    /**
     * @return the questionTypeID
     */
    public Integer getQuestionTypeID() {
        return questionTypeID;
    }

    /**
     * @param questionTypeID
     *                the questionTypeID to set
     */
    public void setQuestionTypeID(Integer questionTypeID) {
        this.questionTypeID = questionTypeID;
    }

    /**
     * @return
     */
    public Integer getDerivedFromID() {
        return derivedFromID;
    }

    /**
     * @param derivedFromID
     *                id of question from which this question is derived
     */
    public void setDerivedFromID(Integer derivedFromID) {
        this.derivedFromID = derivedFromID;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return this.text;
    }

    /* (non-Javadoc)
     * @see java.lang.Comparable#compareTo(java.lang.Object)
     */
    @Override
    public int compareTo(Question arg0) {
        return this.difficulty.compareTo(arg0.difficulty);
    }

}
